package com.zhixi.controller;

import com.zhixi.entity.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;


/**
 * @作者 ShuHaoNan
 * @邮箱 shuhaonan1@gmail.com
 * @时间 2020/11/9 20:31
 */
@RestController
@RequestMapping("/zhixi")
@Api(tags = "前端登录页面")
public class LoginController {

    @ApiOperation("登录")
    @PostMapping("/login")
    public R login() {
        return R.ok().data("token", "admin");
    }

    @ApiOperation("获取用户信息")
    @GetMapping("/info")
    public R info() {
        return R.ok().data("roles", "admin").data("name", "芷兮").data("avatar", "https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif");
    }

    @ApiOperation("退出登录")
    @PostMapping("/logout")
    public R logout() {
        return R.ok();
    }

}
